<load href="__JS__/My97DatePicker/WdatePicker.js" />
<script type="text/javascript">
    function _afterComplete(){
        jump(TP_URL,1000);
    }
</script>

<div class="row-fluid">

    <div class="box span12" style="margin-top: 0">

        <div class="box-header well" data-original-title="">
            <h2><i class="icon-edit"></i> {$Think.lang.common_add} {$pagetitle}</h2>
        </div>
        <div class="box-content">
            <form class="form-horizontal" action="__URL__/insert" method="post" id="baseForm">
                <fieldset>

                    <div class="control-group">
                        <label class="control-label" for="title">{$Think.lang.common_title}</label>
                        <div class="controls">
                            <input class="input-xlarge focused" id="title" type="text" name="title" value="{$row.title}">
                        </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label" for="begin_at">{$Think.lang.common_begin_at}</label>
                        <div class="controls">
                            <div class="input-append">
                            <input class="span12 focused" id="begin_at" type="text" name="begin_at" value="<?php echo date('Y-m-d H:i:s');?>" required  onClick="WdatePicker({lang:'en',dateFmt:'yyyy-MM-dd HH:mm:ss'})">
                            <button type="button" class="btn" onclick="WdatePicker({lang:'en',dateFmt:'yyyy-MM-dd HH:mm:ss',el:'begin_at'})"><i class="icon-calendar"></i></button>
                            </div>
                        </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label" for="begin_time">{$Think.lang.common_begin_time}</label>
                        <div class="controls">
                            <div class="input-append">
                            <input class="span12 focused" id="begin_time" type="text" name="begin_time" value="<?php echo date('H:i:s');?>" required  onClick="WdatePicker({lang:'en',dateFmt:'HH:mm:ss'})"  readonly="readonly">
                            <button type="button" class="btn" onclick="WdatePicker({lang:'en',dateFmt:'HH:mm:ss',el:'begin_time'})"><i class="icon-calendar"></i></button>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="template_id">{$Think.lang.common_email_template}</label>
                        <div class="controls">
                            <select name="template_id" id="template_id">
                                <volist name="templates" id="template">
                                <option value="{$template.template_id}">{$template.title}</option>
                                </volist>
                            </select>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="interval">{$Think.lang.common_email_interval}</label>
                        <div class="controls">
                            <select name="interval" id="interval">
                                <?php for($i = 30; $i > 0; $i--):?>
                                <option value="<?php echo $i;?>"><?php echo $i;?></option>
                                <?php endfor;?>
                            </select>
                            <span class="help-inline">{:L('common_email_interval_help')}</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="email_limit">{$Think.lang.common_email_limit}</label>
                        <div class="controls">
                            <input class="input-xlarge focused" id="email_limit" type="text" name="email_limit" value="5" readonly="readonly">
                            <span class="help-inline">{:L('common_email_limit_help')}</span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="status">{$Think.lang.common_status}</label>
                        <div class="controls">
                           <label class="radio">
                            <input type="radio" name="status" id="optionsRadios1" value="1" checked>
                            {$Think.lang.common_on}
                            </label>
                            <label class="radio">
                            <input type="radio" name="status" id="optionsRadios2" value="0">
                            {$Think.lang.common_off}
                            </label>
                        </div>
                    </div>


                    <include file="Public:action"/>
                </fieldset>
            </form>

        </div>
    </div>
</div>